package com.zb.vo;

import com.zb.entity.ZjUserType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.Date;

/**
 * @Author WEN
 * @Date 2023/8/9 0009
 **/
@Data
@ApiModel("用户分类列表结果对象")
public class UserTypeListVo {
    @ApiModelProperty(value = "用户分类ID")
    private Long id;

    @ApiModelProperty(value = "分类名称")
    private String name;

    @ApiModelProperty(value = "分配知识库类型名称")
    private String knowledgeType;

    @ApiModelProperty(value = "分类状态：false-启用，true-禁用")
    private Boolean status;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    public static UserTypeListVo beanToVo(ZjUserType type) {
        UserTypeListVo vo = new UserTypeListVo();
        BeanUtils.copyProperties(type, vo);
        vo.setStatus(type.getDisabled());
        vo.setCreateTime(type.getGmtCreate());
        vo.setUpdateTime(type.getGmtUpdate());
        return vo;
    }
}
